package com.stud.system.domain;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.stud.common.annotation.Excel;
import com.stud.common.core.domain.BaseEntity;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.*;

import javax.validation.constraints.NotBlank;

/**
 * 流程实例对象 t_workflow
 *
 * @author Stud
 * @date 2023-03-06
 */
@ApiModel("流程实例")
@Data
@TableName("t_workflow")
public class Workflow extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Excel(name = "流程编码")
    @ApiModelProperty(name = "definitionCode", value = "流程编码")
    private String definitionCode;

    @TableField(condition = SqlCondition.LIKE)
    @Excel(name = "流程名称")
    @ApiModelProperty(name = "definitionName", value = "流程名称")
    private String definitionName;

    @Excel(name = "流程类型")
    @NotBlank(message = "流程类型不能为空")
    @ApiModelProperty(name = "definitionType", value = "流程类型(0:串行;1:并行)")
    private String definitionType;

    @Excel(name = "业务ID")
    @ApiModelProperty(name = "businessId", value = "业务ID")
    private Long businessId;

    @Excel(name = "业务编码")
    @ApiModelProperty(name = "businessCode", value = "业务编码")
    private String businessCode;

    @Excel(name = "业务表名")
    @ApiModelProperty(name = "businessTable", value = "业务表名")
    private String businessTable;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "startTime", value = "开始时间")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "endTime", value = "结束时间")
    private Date endTime;

    @Excel(name = "当前任务ID")
    @ApiModelProperty(name = "taskId", value = "当前任务ID")
    private Long taskId;

    @Excel(name = "当前任务名称")
    @ApiModelProperty(name = "taskName", value = "当前任务名称")
    private String taskName;

    @Excel(name = "当前任务角色编码")
    @ApiModelProperty(name = "roleCode", value = "当前任务角色编码")
    private String roleCode;

    @Excel(name = "流程状态(-1:审核驳回;0:待审核;1:审核中;2:审核通过;)")
    @ApiModelProperty(name = "workflowStatus", value = "流程状态(-1:审核驳回;0:待审核;1:审核中;2:审核通过;)")
    private Integer workflowStatus;

    @Excel(name = "开关")
    @ApiModelProperty(name = "flag", value = "开关")
    private String flag;

    @TableField(exist = false)
    private String workflowRemark;

    @TableField(exist = false)
    private Date lastApproveTime;

    @TableField(exist = false)
    private String roleName;
}
